home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 January / macformat-020.iso / Shareware City / Developers / apps.to.go / AppWannabe / TRootObj.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-05-11  |  2.3 KB  |  102 lines  |  [TEXT/MPS ]

  1. /*
  2. ** Apple Macintosh Developer Technical Support
  3. **
  4. ** File:        TRootObj.c
  5. ** Written by:    Eric Soldan
  6. **
  7. ** Copyright © 1992 Apple Computer, Inc.
  8. ** All rights reserved.
  9. */
  10.  
  11. /* You may incorporate this sample code into your applications without
  12. ** restriction, though the sample code has been provided "AS IS" and the
  13. ** responsibility for its operation is 100% yours.  However, what you are
  14. ** not permitted to do is to redistribute the source as "DSC Sample Code"
  15. ** after having made changes. If you're going to re-distribute the source,
  16. ** we require that you make it clear in the source that the code was
  17. ** descended from Apple Sample Code, but that you've made changes. */
  18.  
  19. /* See the files "=How to write your app" and "=Using TreeObj.c" for information
  20. ** on this function. */
  21.  
  22. /* This file isn't really used for much here.  The whole hierarchical document usage of
  23. ** AppWannabe is very limited.  This file is here so that AppWannabe can be converted
  24. ** into an application that does use the hierarchical document architecture.  AppWannabe
  25. ** is all set up to start using it.  This is convenient, as it allows there to be an
  26. ** initial document type. */
  27.  
  28.  
  29.  
  30. /*****************************************************************************/
  31.  
  32.  
  33.  
  34. #include "App.h"            /* Get the application includes/typedefs, etc.    */
  35. #include "App.protos.h"        /* Get the prototypes for application.            */
  36.  
  37. #ifndef __OSEVENTS__
  38. #include <OSEvents.h>
  39. #endif
  40.  
  41. #ifndef __OSUTILS__
  42. #include <OSUtils.h>
  43. #endif
  44.  
  45. #ifndef __QUICKDRAW__
  46. #include <Quickdraw.h>
  47. #endif
  48.  
  49. #ifndef __UTILITIES__
  50. #include "Utilities.h"
  51. #endif
  52.  
  53.  
  54.  
  55. #pragma segment DrawObjects
  56. long    TRootObj(TreeObjHndl hndl, short message, long data)
  57. {
  58.     short    fileRefNum;
  59. #if VH_VERSION
  60.     char    *cptr;
  61. #endif
  62.  
  63.     switch (message) {
  64.         case FREADMESSAGE:
  65.             fileRefNum = data;
  66.             return(ReadTreeObjData(hndl, fileRefNum));
  67.             break;
  68.  
  69.         case FWRITEMESSAGE:
  70.             fileRefNum = data;
  71.             return(WriteTreeObjData(hndl, fileRefNum));
  72.             break;
  73.  
  74.         case HREADMESSAGE:
  75.             return(HReadTreeObjData(hndl, (Handle)data));
  76.             break;
  77.  
  78.         case HWRITEMESSAGE:
  79.             return(HWriteTreeObjData(hndl, (Handle)data));
  80.             break;
  81.  
  82.         case VHMESSAGE:
  83. #if VH_VERSION
  84.             cptr = ((VHFormatDataPtr)data)->data;
  85.             ccatchr(cptr, 13, 2);
  86.             VHRootInfo(hndl, cptr);
  87.             ccatchr(cptr, 13, 2);
  88.             VHFileRecInfo(hndl, cptr);
  89.             return(true);
  90. #endif
  91.             break;
  92.  
  93.         default:
  94.             break;
  95.     }
  96.  
  97.     return(noErr);
  98. }
  99.  
  100.  
  101.  
  102.